package customer.zspt.cn.customer.activitys;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;

import customer.zspt.cn.customer.R;
import customer.zspt.cn.customer.constant.constant;
import customer.zspt.cn.customer.utils.SPUtils;

/**
 * Created by Administrator on 2018/6/17 0017.
 */
public class Welcome extends Activity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);
        final String result = SPUtils.getString(this, constant.LOGINRESULT,"");
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                  if(result.equals("")){
                      login();
                  }
                  else{
                    home();
                }
                  finish();
            }
        },3000);
    }
    public void login(){
        Intent intent = new Intent(this,login.class);
        startActivity(intent);
    }
    public void home(){
        Intent intent = new Intent(this,main.class);
        startActivity(intent);
    }
}
